:root {
  font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  font-weight: 400;

  color-scheme: light dark;
  color: rgba(255, 255, 255, 0.87);
  background-color: #242424;

  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
}

a {
  font-weight: 500;
  color: #646cff;
  text-decoration: inherit;
}
a:hover {
  color: #535bf2;
}

body {
  margin: 0;
  display: flex;
  place-items: center;
  min-width: 320px;
  min-height: 100vh;
}

h1 {
  font-size: 3.2em;
  line-height: 1.1;
}

button {
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0.6em 1.2em;
  font-size: 1em;
  font-weight: 500;
  font-family: inherit;
  background-color: #1a1a1a;
  cursor: pointer;
  transition: border-color 0.25s;
}
button:hover {
  border-color: #646cff;
}
button:focus,
button:focus-visible {
  outline: 4px auto -webkit-focus-ring-color;
}

.card {
  padding: 2em;
}

#app {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem;
  text-align: center;
}

@media (prefers-color-scheme: light) {
  :root {
    color: #213547;
    background-color: #ffffff;
  }
  a:hover {
    color: #747bff;
  }
  button {
    background-color: #f9f9f9;
  }
}


    /* 按钮容器 */
    .kiki-button-container {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 0 8px;
      pointer-events: none;
  }

  /* 按钮样式 */
  .kiki-action-button {
      background: none;
      border: none;
      padding: 8px 12px;
      cursor: pointer;
      border-radius: 4px;
      color: #54656f;
      font-size: 14px;
      transition: background-color 0.2s;
      pointer-events: auto;
  }

  .kiki-action-button:hover {
      background-color: rgba(0, 0, 0, 0.05);
  }

  /* 对话框样式 */
  .kiki-dialog-overlay {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: rgba(0, 0, 0, 0.5);
      display: none;
      z-index: 3085;
  }

  .kiki-dialog {
      position: fixed;
      top: 80px;
      left: 50%;
      transform: translateX(-50%);
      background: white;
      border-radius: 8px;
      width: 480px;
      z-index: 3086;
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  }

  .kiki-dialog-header {
      padding: 16px 20px;
      border-bottom: 1px solid #e9edef;
      display: flex;
      justify-content: space-between;
      align-items: center;
  }

  .kiki-dialog-title {
      font-size: 16px;
      color: #111b21;
      font-weight: 500;
  }

  .kiki-dialog-close {
      background: none;
      border: none;
      cursor: pointer;
      padding: 4px;
      color: #54656f;
      font-size: 18px;
  }

  .kiki-dialog-body {
      padding: 20px;
  }

  .kiki-dialog-footer {
      padding: 16px 20px;
      text-align: right;
      border-top: 1px solid #e9edef;
  }

  /* 表单样式 */
  .kiki-form-item {
      margin-bottom: 20px;
  }

  .kiki-form-label {
      display: block;
      margin-bottom: 8px;
      color: #111b21;
      font-size: 14px;
  }

  .kiki-input {
      width: 100%;
      padding: 8px 12px;
      border: 1px solid #e9edef;
      border-radius: 8px;
      font-size: 14px;
      color: #111b21;
      transition: border-color 0.2s;
  }

  .kiki-input:focus {
      outline: none;
      border-color: #00a884;
  }

  .kiki-input::placeholder {
      color: #8696a0;
  }

  /* 按钮样式 */
  .kiki-btn {
      padding: 8px 20px;
      border: none;
      border-radius: 4px;
      cursor: pointer;
      font-size: 14px;
      font-weight: 500;
      transition: background-color 0.2s;
  }

  .kiki-btn-primary {
      background: #00a884;
      color: white;
  }

  .kiki-btn-primary:hover {
      background: #008f72;
  }

  .kiki-btn-secondary {
      background: #e9edef;
      color: #54656f;
      margin-right: 12px;
  }

  .kiki-btn-secondary:hover {
      background: #dfe3e6;
  }

  /* 标签选择器样式 */
  .kiki-tags {
      display: flex;
      flex-wrap: wrap;
      gap: 12px;
  }

  .kiki-radio {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      cursor: pointer;
      padding: 8px 16px;
      border: 1px solid #e9edef;
      border-radius: 8px;
      transition: all 0.2s;
  }

  .kiki-radio:hover {
      background-color: #f5f6f6;
  }

  .kiki-radio input {
      margin: 0;
  }

  /* 开关样式 */
  .kiki-switch {
      display: flex;
      align-items: center;
  }

  .kiki-switch input[type="checkbox"] {
      display: none;
  }

  .kiki-switch label {
      position: relative;
      display: inline-block;
      width: 40px;
      height: 20px;
      background-color: #ddd;
      border-radius: 20px;
      transition: all 0.3s;
      cursor: pointer;
      margin-right: 8px;
  }

  .kiki-switch label:after {
      content: '';
      position: absolute;
      width: 16px;
      height: 16px;
      border-radius: 50%;
      background-color: white;
      top: 2px;
      left: 2px;
      transition: all 0.3s;
  }

  .kiki-switch input[type="checkbox"]:checked + label {
      background-color: #00a884;
  }

  .kiki-switch input[type="checkbox"]:checked + label:after {
      left: 22px;
  }

  /* 文本域样式 */
  .kiki-input[rows] {
      resize: vertical;
      min-height: 60px;
  }

  .kiki-status-selector {
      display: flex !important;  /* 覆盖之前的 inline-block */
      align-items: center;
      padding: 12px 16px;
      border-bottom: 1px solid rgba(134, 150, 160, 0.15);
      gap: 12px;
  }

  /* 状态选择下拉框样式 */
  .kiki-status-select {
      min-width: 120px;
      padding: 8px;
      border-radius: 8px;
      border: 1px solid #ddd;
      background-color: white;
      font-size: 14px;
      outline: none;
      margin-left: 12px;
  }

  .kiki-status-select:hover {
      background-color: #f0f0f0;
  }

  /* 发送新消息按钮样式 */
  .kiki-direct-message-btn {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 8px 12px;
      background: none;
      border: 1px solid #00a884;
      border-radius: 4px;
      color: #00a884;
      font-size: 13px;
      cursor: pointer;
      transition: all 0.2s;
      white-space: nowrap;
      flex-shrink: 0;
  }

  .kiki-direct-message-btn:hover {
      background-color: rgba(0, 168, 132, 0.1);
  }

  .kiki-direct-message-btn:active {
      transform: translateY(1px);
  }

  .kiki-direct-message-btn svg {
      width: 20px;
      height: 20px;
  }

  /* 确保图标颜色与文字一致 */
  .kiki-direct-message-btn svg path {
      fill: currentColor;
  }
  /* WhatsApp 消息翻译相关样式 */
  .translate-btn a {
      color: #00a884;
      font-size: 12px;
      text-decoration: none;
      cursor: pointer;
      margin-top: 4px;
      display: inline-block;
  }

  .translate-btn a:hover {
      text-decoration: underline;
  }

  .translation-result {
      font-size: 13px;
      color: #667781;
      margin-top: 4px;
      padding: 2px 0;
      font-style: italic;
      line-height: 1.4;
  }

  .translation-loading {
      color: #8696a0;
      font-size: 13px;
  }

  .translation-error {
      color: #ef5350;
      font-size: 13px;
  }

  .kiki-translate-wrap {
      position: relative;
      display: inline-flex;
      align-items: center;
      margin-left: 8px;
      cursor: pointer;
  }

  .kiki-translate-icon {
      width: 22px;
      height: 22px;
      fill: #5964ff;
  }

  .kiki-translate-dialog {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(0, 0, 0, 0.5);
      display: none;
      z-index: 999999;
  }

  .kiki-translate-dialog-content {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      width: 500px;
      background: white;
      border-radius: 8px;
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  }

  .kiki-translate-dialog-header {
      padding: 16px;
      border-bottom: 1px solid #eee;
      display: flex;
      align-items: center;
      justify-content: space-between;
  }

  .kiki-translate-dialog-title {
      display: flex;
      align-items: center;
      gap: 8px;
      font-size: 16px;
      font-weight: 500;
  }

  .kiki-translate-dialog-close {
      border: none;
      background: none;
      cursor: pointer;
      font-size: 20px;
      color: #666;
      padding: 4px;
  }

  .kiki-translate-dialog-body {
      padding: 20px;
  }

  .kiki-translate-input {
      width: 95%;
      min-height: 100px;
      padding: 12px;
      border: 1px solid #ddd;
      border-radius: 4px;
      margin-bottom: 16px;
      resize: vertical;
  }

  /* 翻译对话框的主体样式 */
  .kiki-translate-dialog-content {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      width: 720px;
      background: white;
      border-radius: 12px;
      box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  }

  /* 对话框头部样式 */
  .kiki-translate-dialog-header {
      padding: 20px 24px;
      border-bottom: 1px solid #e9edef;
      display: flex;
      align-items: center;
      justify-content: space-between;
  }

  .kiki-translate-dialog-title {
      display: flex;
      align-items: center;
      gap: 12px;
      font-size: 18px;
      font-weight: 600;
      color: #111b21;
  }

  .kiki-translate-dialog-title svg {
      width: 24px;
      height: 24px;
  }

  /* 对话框主体部分 */
  .kiki-translate-dialog-body {
      padding: 24px;
  }

  /* 语言选择下拉框 */
  .kiki-translate-language-select {
      margin-bottom: 20px;
  }

  .kiki-language-select {
      padding: 10px 12px;
      border: 1px solid #e9edef;
      border-radius: 8px;
      font-size: 14px;
      width: 200px;
      color: #111b21;
      background-color: white;
      cursor: pointer;
      transition: all 0.2s;
  }

  .kiki-language-select:focus {
      border-color: #00a884;
      outline: none;
      box-shadow: 0 0 0 2px rgba(0, 168, 132, 0.1);
  }

  /* 输入框容器 */
  .kiki-translate-input-container {
      margin-bottom: 20px;
  }

  /* 输入框样式 */
  .kiki-translate-input {
      width: 95%;
      min-height: 120px;
      padding: 16px;
      border: 1px solid #e9edef;
      border-radius: 8px;
      font-size: 15px;
      line-height: 1.5;
      color: #111b21;
      resize: vertical;
      transition: all 0.2s;
  }

  .kiki-translate-input:focus {
      border-color: #00a884;
      outline: none;
      box-shadow: 0 0 0 2px rgba(0, 168, 132, 0.1);
  }

  /* 翻译结果容器 */
  .kiki-translate-result-container {
      margin-top: 20px;
      border: 1px solid #e9edef;
      border-radius: 8px;
      padding: 16px;
      background-color: #f8f9fa;
  }

  /* 结果头部 */
  .kiki-translate-result-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 12px;
      padding-bottom: 12px;
      border-bottom: 1px solid #e9edef;
  }

  .kiki-translate-result-header span {
      font-size: 15px;
      font-weight: 500;
      color: #111b21;
  }

  /* 复制按钮 */
  .kiki-translate-copy-btn {
      display: flex;
      align-items: center;
      gap: 6px;
      padding: 8px 12px;
      border: 1px solid #e9edef;
      border-radius: 6px;
      background: white;
      cursor: pointer;
      color: #54656f;
      font-size: 13px;
      transition: all 0.2s;
  }

  .kiki-translate-copy-btn:hover {
      background-color: #f5f6f6;
      border-color: #00a884;
      color: #00a884;
  }

  .kiki-translate-copy-btn svg {
      width: 16px;
      height: 16px;
  }

  /* 翻译结果文本 */
  .kiki-translate-result {
      font-size: 15px;
      line-height: 1.6;
      color: #111b21;
      white-space: pre-wrap;
      word-break: break-word;
      padding: 4px;
  }

  /* 翻译和发送按钮的公共样式 */
  .kiki-translate-actions {
      display: flex;
      justify-content: flex-end;
      gap: 12px;
      margin-top: 20px;
  }

  /* 翻译按钮修改为小号并设置为蓝色 */
  .kiki-translate-submit {
      padding: 8px 16px;
      background-color: #5964ff;
      color: white;
      border: none;
      border-radius: 6px;
      font-size: 14px;
      font-weight: 500;
      cursor: pointer;
      transition: all 0.2s;
      height: 36px;
      display: flex;
      align-items: center;
  }

  .kiki-translate-submit:hover {
      background-color: #4853e0;
  }


  .kiki-translate-submit:disabled {
      background-color: #cccccc;
      cursor: not-allowed;
  }

  /* 关闭按钮 */
  .kiki-translate-dialog-close {
      width: 32px;
      height: 32px;
      border: none;
      background: none;
      border-radius: 50%;
      cursor: pointer;
      color: #54656f;
      font-size: 24px;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all 0.2s;
  }

  .kiki-translate-dialog-close:hover {
      background-color: #f0f2f5;
  }


  .kiki-translate-result {
      width: 95%;
      min-height: 120px;
      padding: 16px;
      border: 1px solid #e9edef;
      border-radius: 8px;
      font-size: 15px;
      line-height: 1.5;
      color: #111b21;
      background-color: #f8f9fa;
      resize: vertical;
      margin-top: 12px;
      transition: all 0.2s;
  }

  .kiki-translate-result:focus {
      outline: none;
      border-color: #00a884;
      box-shadow: 0 0 0 2px rgba(0, 168, 132, 0.1);
  }

  /* 使只读状态的文本框看起来更清晰 */
  .kiki-translate-result[readonly] {
      cursor: text;
      background-color: #f8f9fa;
  }

  /* Translate drawer styles */
  .kiki-translate-drawer {
      position: fixed;
      top: 0;
      left: -600px;
      width: 600px;
      height: 100vh;
      background: white;
      box-shadow: 2px 0 8px rgba(0,0,0,0.15);
      z-index: 999999;
      transition: left 0.3s ease-in-out;
      display: flex;
      flex-direction: column;
  }

  .kiki-translate-drawer.active {
      left: 0;
  }

  .kiki-translate-drawer-overlay {
      position: fixed;
      top: 0;
      left: 0;
      width: 100vw;
      height: 100vh;
      background: rgba(0,0,0,0.4);
      z-index: 999998;
      display: none;
  }

  .kiki-translate-drawer.active + .kiki-translate-drawer-overlay {
      display: block;
  }

  .kiki-translate-drawer-content {
      height: 100%;
      display: flex;
      flex-direction: column;
      overflow: hidden;
  }

  .kiki-translate-drawer-header {
      padding: 20px 24px;
      border-bottom: 1px solid #e9edef;
      display: flex;
      align-items: center;
      justify-content: space-between;
  }

  .kiki-translate-drawer-body {
      padding: 24px;
      flex: 1;
      overflow-y: auto;
  }

  .kiki-translate-drawer-close {
      width: 32px;
      height: 32px;
      border: none;
      background: none;
      border-radius: 50%;
      cursor: pointer;
      color: #54656f;
      font-size: 24px;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all 0.2s;
  }

  .kiki-translate-drawer-close:hover {
      background-color: #f0f2f5;
  }


  /* Tab styles for translate drawer */
  .kiki-translate-tabs {
      display: flex;
      border-bottom: 1px solid #e9edef;
      margin-bottom: 16px;
  }

  .kiki-translate-tab {
      padding: 12px 24px;
      cursor: pointer;
      font-size: 14px;
      color: #54656f;
      background: none;
      border: none;
      border-bottom: 2px solid transparent;
      transition: all 0.2s;
  }

  .kiki-translate-tab.active {
      color: #00a884;
      border-bottom-color: #00a884;
      font-weight: 500;
  }

  .kiki-translate-tab-content {
      display: none;
  }

  .kiki-translate-tab-content.active {
      display: block;
  }

  .kiki-prompt-select {
      flex: 1;
      padding: 8px 12px;
      border: 1px solid #e9edef;
      border-radius: 8px;
      margin-right: 12px;
      font-size: 14px;
      color: #111b21;
  }

  .kiki-prompt-wrapper {
      display: flex;
      align-items: center;
      gap: 12px;
      margin-bottom: 16px;
  }

  .kiki-prompt-execute {
      padding: 8px 16px;
      background-color: #00a884;
      color: white;
      border: none;
      border-radius: 8px;
      cursor: pointer;
      font-size: 14px;
      transition: background-color 0.2s;
  }

  .kiki-prompt-execute:hover {
      background-color: #008f72;
  }

  .kiki-prompt-result {
      width: 100%;
      min-height: 120px;
      padding: 16px;
      border: 1px solid #e9edef;
      border-radius: 8px;
      font-size: 15px;
      line-height: 1.5;
      color: #111b21;
      background-color: #f8f9fa;
      resize: vertical;
      margin-top: 12px;
  }


  .kiki-prompt-result-wrapper {
      flex: 1;
      overflow: auto;
      background: #f8f9fa;
      border-radius: 8px;
      border: 1px solid #e9edef;
      margin-top: 16px;
  }

  .kiki-prompt-result {
      width: 100%;
      min-height: 400px;
      max-height: calc(100vh - 300px);
      padding: 20px;
      margin: 0;
      white-space: pre-wrap;
      word-wrap: break-word;
      font-family: monospace;
      font-size: 14px;
      line-height: 1.5;
      color: #111b21;
      background: transparent;
      border: none;
      outline: none;
      overflow: auto;
  }

  .kiki-prompt-select {
      flex: 1;
      padding: 10px 12px;
      border: 1px solid #e9edef;
      border-radius: 8px;
      font-size: 14px;
      color: #111b21;
      background-color: white;
  }

  .kiki-prompt-execute {
      padding: 10px 24px;
      background-color: #00a884;
      color: white;
      border: none;
      border-radius: 8px;
      font-size: 14px;
      font-weight: 500;
      cursor: pointer;
      transition: all 0.2s;
  }

  .kiki-prompt-execute:hover {
      background-color: #008f72;
  }

  .kiki-cached-results {
      margin: 16px 0;
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
  }

  .kiki-cached-result-btn {
      padding: 8px 16px;
      background-color: #f0f2f5;
      color: #54656f;
      border: 1px solid #e9edef;
      border-radius: 8px;
      font-size: 14px;
      cursor: pointer;
      transition: all 0.2s;
  }

  .kiki-cached-result-btn:hover {
      background-color: #e9edef;
      color: #111b21;
  }

  .kiki-prompt-result {
      background-color: #fdfdfd;
      padding: 20px;
      border-radius: 8px;
      line-height: 1.6;
      font-size: 14px;
      font-family: Arial, sans-serif;
      white-space: pre-wrap; /* 允许自动换行 */
      color: #333;
  }

  .kiki-prompt-result h1,
  .kiki-prompt-result h2,
  .kiki-prompt-result h3 {
      font-weight: bold;
      margin-top: 1.2em;
      margin-bottom: 0.6em;
      line-height: 1.4;
  }

  .kiki-prompt-result h1 {
      font-size: 18px;
      border-bottom: 1px solid #ddd;
      padding-bottom: 4px;
      color: #222;
  }

  .kiki-prompt-result h2 {
      font-size: 16px;
      border-bottom: 1px solid #eee;
      padding-bottom: 3px;
      color: #333;
  }

  .kiki-prompt-result h3 {
      font-size: 14px;
      color: #444;
  }

  .kiki-prompt-result p {
      margin-bottom: 1em;
      color: #555;
  }

  .kiki-prompt-result a {
      color: #00a884;
      text-decoration: none;
  }
  .kiki-prompt-result a:hover {
      text-decoration: underline;
  }


  /* 翻译结果容器样式更新 */
.kiki-translate-result-container {
  margin-top: 20px;
  border: 1px solid #e9edef;
  border-radius: 8px;
  padding: 16px;
  background-color: #f8f9fa;
}

/* 发送按钮统一大小并靠右 */
.kiki-translate-result-actions {
  display: flex;
  justify-content: flex-end;!important;  /* 确保这里是 flex-end */
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e9edef;
}

.kiki-translate-send-btn {
  padding: 8px 16px;
  background-color: #00a884;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  height: 36px;
  display: flex;
  align-items: center;
}

.kiki-translate-send-btn:hover {
  background-color: #008f72;
}

/* 统一禁用状态样式 */
.kiki-translate-submit:disabled,
.kiki-translate-send-btn:disabled {
  background-color: #cccccc;
  cursor: not-allowed;
}